home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
UNIX
/
C
/
C-STYLE
/
STYLE_CO.SED
< prev
next >
Wrap
Text File
|
1992-11-23
|
458b
|
35 lines
s/ Decomment a C program /&/
:start
s/ Strip trailing spaces /&/
/[ ]*$/ s/[ ]*$//
s/ Lose comment-only lines /&/
/^[ ]*@.*`$/ d
s/ Strip short comments /&/
/@.*`/ s/@[^@]*`//g
s/ Strip multiple comments /&/
/^[ ]*@.*$/ b loop
/@.*$/ { s/[ ]*@.*$//p
:loop
n
s/ Ensure flag is reset /&/
t dummy
:dummy
s/ Go on until delimiter /&/
s/^[^@]*`//
/^[ ]*$/ d
t start
b loop
}
s/ Print whatever's left /&/
p